<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\common\model;

use think\Model;

class Config extends Model
{
	//全部系统配置
	public function allConfig()
	{
		//todo数据缓存
		$data = array();
		$list = $this->select();
		foreach ($list as $key => $val) {
			$data[$val['key_name']] = $val['key_value'];
		}
		return $data;
	}
	//全部系统配置数据
	public function allConfigList()
	{
		//todo数据缓存
		$data = array();
		$list = $this->select();
		return $list;
	}
	//获取单数据
	public function oneConfig($key)
	{
		$data = $this->site_config();
		return $data[$key];
	}
}